Integrand size = 28, antiderivative size = 153 \[ \int \frac {\sec ^4(c+d x)}{a \cos (c+d x)+b \sin (c+d x)} \, dx=-\frac {a \text {arctanh}(\sin (c+d x))}{2 b^2 d}-\frac {a \left (a^2+b^2\right ) \text {arctanh}(\sin (c+d x))}{b^4 d}-\frac {\left (a^2+b^2\right )^{3/2} \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{b^4 d}+\frac {\left (a^2+b^2\right ) \sec (c+d x)}{b^3 d}+\frac {\sec ^3(c+d x)}{3 b d}-\frac {a \sec (c+d x) \tan (c+d x)}{2 b^2 d} \]
-1/2*a*arctanh(sin(d*x+c))/b^2/d-a*(a^2+b^2)*arctanh(sin(d*x+c))/b^4/d-(a^ 2+b^2)^(3/2)*arctanh((b*cos(d*x+c)-a*sin(d*x+c))/(a^2+b^2)^(1/2))/b^4/d+(a ^2+b^2)*sec(d*x+c)/b^3/d+1/3*sec(d*x+c)^3/b/d-1/2*a*sec(d*x+c)*tan(d*x+c)/ b^2/d
Leaf count is larger than twice the leaf count of optimal. \(321\) vs. \(2(153)=306\).
Time = 2.15 (sec) , antiderivative size = 321, normalized size of antiderivative = 2.10 \[ \int \frac {\sec ^4(c+d x)}{a \cos (c+d x)+b \sin (c+d x)} \, dx=\frac {48 \left (a^2+b^2\right )^{3/2} \text {arctanh}\left (\frac {-b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )+\sec ^3(c+d x) \left (12 a^2 b+20 b^3+12 b \left (a^2+b^2\right ) \cos (2 (c+d x))+6 a^3 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+9 a b^2 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+9 a \left (2 a^2+3 b^2\right ) \cos (c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )-6 a^3 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-9 a b^2 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-6 a b^2 \sin (2 (c+d x))\right )}{24 b^4 d} \]
(48*(a^2 + b^2)^(3/2)*ArcTanh[(-b + a*Tan[(c + d*x)/2])/Sqrt[a^2 + b^2]] + Sec[c + d*x]^3*(12*a^2*b + 20*b^3 + 12*b*(a^2 + b^2)*Cos[2*(c + d*x)] + 6 *a^3*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 9*a*b^2*C os[3*(c + d*x)]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 9*a*(2*a^2 + 3* b^2)*Cos[c + d*x]*(Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) - 6*a^3*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2 ] + Sin[(c + d*x)/2]] - 9*a*b^2*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2] + Si n[(c + d*x)/2]] - 6*a*b^2*Sin[2*(c + d*x)]))/(24*b^4*d)
Time = 0.69 (sec) , antiderivative size = 150, normalized size of antiderivative = 0.98, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {3042, 3583, 3042, 3583, 3042, 3553, 219, 4255, 3042, 4257}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sec ^4(c+d x)}{a \cos (c+d x)+b \sin (c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\cos (c+d x)^4 (a \cos (c+d x)+b \sin (c+d x))}dx\) |
\(\Big \downarrow \) 3583 |
\(\displaystyle \frac {\left (a^2+b^2\right ) \int \frac {\sec ^2(c+d x)}{a \cos (c+d x)+b \sin (c+d x)}dx}{b^2}-\frac {a \int \sec ^3(c+d x)dx}{b^2}+\frac {\sec ^3(c+d x)}{3 b d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\left (a^2+b^2\right ) \int \frac {1}{\cos (c+d x)^2 (a \cos (c+d x)+b \sin (c+d x))}dx}{b^2}-\frac {a \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx}{b^2}+\frac {\sec ^3(c+d x)}{3 b d}\) |
\(\Big \downarrow \) 3583 |
\(\displaystyle \frac {\left (a^2+b^2\right ) \left (\frac {\left (a^2+b^2\right ) \int \frac {1}{a \cos (c+d x)+b \sin (c+d x)}dx}{b^2}-\frac {a \int \sec (c+d x)dx}{b^2}+\frac {\sec (c+d x)}{b d}\right )}{b^2}-\frac {a \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx}{b^2}+\frac {\sec ^3(c+d x)}{3 b d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\left (a^2+b^2\right ) \left (\frac {\left (a^2+b^2\right ) \int \frac {1}{a \cos (c+d x)+b \sin (c+d x)}dx}{b^2}-\frac {a \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{b^2}+\frac {\sec (c+d x)}{b d}\right )}{b^2}-\frac {a \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx}{b^2}+\frac {\sec ^3(c+d x)}{3 b d}\) |
\(\Big \downarrow \) 3553 |
\(\displaystyle \frac {\left (a^2+b^2\right ) \left (-\frac {\left (a^2+b^2\right ) \int \frac {1}{a^2+b^2-(b \cos (c+d x)-a \sin (c+d x))^2}d(b \cos (c+d x)-a \sin (c+d x))}{b^2 d}-\frac {a \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{b^2}+\frac {\sec (c+d x)}{b d}\right )}{b^2}-\frac {a \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx}{b^2}+\frac {\sec ^3(c+d x)}{3 b d}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {\left (a^2+b^2\right ) \left (-\frac {a \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{b^2}-\frac {\sqrt {a^2+b^2} \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{b^2 d}+\frac {\sec (c+d x)}{b d}\right )}{b^2}-\frac {a \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx}{b^2}+\frac {\sec ^3(c+d x)}{3 b d}\) |
\(\Big \downarrow \) 4255 |
\(\displaystyle \frac {\left (a^2+b^2\right ) \left (-\frac {a \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{b^2}-\frac {\sqrt {a^2+b^2} \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{b^2 d}+\frac {\sec (c+d x)}{b d}\right )}{b^2}-\frac {a \left (\frac {1}{2} \int \sec (c+d x)dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )}{b^2}+\frac {\sec ^3(c+d x)}{3 b d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\left (a^2+b^2\right ) \left (-\frac {a \int \csc \left (c+d x+\frac {\pi }{2}\right )dx}{b^2}-\frac {\sqrt {a^2+b^2} \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{b^2 d}+\frac {\sec (c+d x)}{b d}\right )}{b^2}-\frac {a \left (\frac {1}{2} \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )}{b^2}+\frac {\sec ^3(c+d x)}{3 b d}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {\left (a^2+b^2\right ) \left (-\frac {\sqrt {a^2+b^2} \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{b^2 d}-\frac {a \text {arctanh}(\sin (c+d x))}{b^2 d}+\frac {\sec (c+d x)}{b d}\right )}{b^2}-\frac {a \left (\frac {\text {arctanh}(\sin (c+d x))}{2 d}+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )}{b^2}+\frac {\sec ^3(c+d x)}{3 b d}\) |
Sec[c + d*x]^3/(3*b*d) + ((a^2 + b^2)*(-((a*ArcTanh[Sin[c + d*x]])/(b^2*d) ) - (Sqrt[a^2 + b^2]*ArcTanh[(b*Cos[c + d*x] - a*Sin[c + d*x])/Sqrt[a^2 + b^2]])/(b^2*d) + Sec[c + d*x]/(b*d)))/b^2 - (a*(ArcTanh[Sin[c + d*x]]/(2*d ) + (Sec[c + d*x]*Tan[c + d*x])/(2*d)))/b^2
3.2.19.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x _Symbol] :> Simp[-d^(-1) Subst[Int[1/(a^2 + b^2 - x^2), x], x, b*Cos[c + d*x] - a*Sin[c + d*x]], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0]
Int[cos[(c_.) + (d_.)*(x_)]^(m_)/(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin [(c_.) + (d_.)*(x_)]), x_Symbol] :> Simp[-Cos[c + d*x]^(m + 1)/(b*d*(m + 1) ), x] + (-Simp[a/b^2 Int[Cos[c + d*x]^(m + 1), x], x] + Simp[(a^2 + b^2)/ b^2 Int[Cos[c + d*x]^(m + 2)/(a*Cos[c + d*x] + b*Sin[c + d*x]), x], x]) / ; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0] && LtQ[m, -1]
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* x]*((b*Csc[c + d*x])^(n - 1)/(d*(n - 1))), x] + Simp[b^2*((n - 2)/(n - 1)) Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[2*n]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 1.00 (sec) , antiderivative size = 269, normalized size of antiderivative = 1.76
method | result | size |
derivativedivides | \(\frac {-\frac {1}{3 b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {a +b}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {2 a^{2}+a b +3 b^{2}}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \left (2 a^{2}+3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 b^{4}}+\frac {1}{3 b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}-\frac {-a +b}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {-2 a^{2}+a b -3 b^{2}}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {a \left (2 a^{2}+3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 b^{4}}-\frac {2 \left (-a^{4}-2 a^{2} b^{2}-b^{4}\right ) \operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b^{4} \sqrt {a^{2}+b^{2}}}}{d}\) | \(269\) |
default | \(\frac {-\frac {1}{3 b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {a +b}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {2 a^{2}+a b +3 b^{2}}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \left (2 a^{2}+3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 b^{4}}+\frac {1}{3 b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}-\frac {-a +b}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {-2 a^{2}+a b -3 b^{2}}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {a \left (2 a^{2}+3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 b^{4}}-\frac {2 \left (-a^{4}-2 a^{2} b^{2}-b^{4}\right ) \operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b^{4} \sqrt {a^{2}+b^{2}}}}{d}\) | \(269\) |
risch | \(\frac {{\mathrm e}^{i \left (d x +c \right )} \left (3 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}+6 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+6 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+12 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+20 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 i b a +6 a^{2}+6 b^{2}\right )}{3 d \,b^{3} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{b^{4} d}+\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 b^{2} d}+\frac {\left (a^{2}+b^{2}\right )^{\frac {3}{2}} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {\left (a^{2}+b^{2}\right )^{\frac {3}{2}} \left (i a -b \right )}{a^{4}+2 a^{2} b^{2}+b^{4}}\right )}{d \,b^{4}}-\frac {\left (a^{2}+b^{2}\right )^{\frac {3}{2}} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {\left (a^{2}+b^{2}\right )^{\frac {3}{2}} \left (i a -b \right )}{a^{4}+2 a^{2} b^{2}+b^{4}}\right )}{d \,b^{4}}-\frac {a^{3} \ln \left (i+{\mathrm e}^{i \left (d x +c \right )}\right )}{b^{4} d}-\frac {3 a \ln \left (i+{\mathrm e}^{i \left (d x +c \right )}\right )}{2 b^{2} d}\) | \(347\) |
1/d*(-1/3/b/(tan(1/2*d*x+1/2*c)-1)^3-1/2*(a+b)/b^2/(tan(1/2*d*x+1/2*c)-1)^ 2-1/2*(2*a^2+a*b+3*b^2)/b^3/(tan(1/2*d*x+1/2*c)-1)+1/2*a*(2*a^2+3*b^2)/b^4 *ln(tan(1/2*d*x+1/2*c)-1)+1/3/b/(tan(1/2*d*x+1/2*c)+1)^3-1/2*(-a+b)/b^2/(t an(1/2*d*x+1/2*c)+1)^2-1/2*(-2*a^2+a*b-3*b^2)/b^3/(tan(1/2*d*x+1/2*c)+1)-1 /2*a*(2*a^2+3*b^2)/b^4*ln(tan(1/2*d*x+1/2*c)+1)-2/b^4*(-a^4-2*a^2*b^2-b^4) /(a^2+b^2)^(1/2)*arctanh(1/2*(2*a*tan(1/2*d*x+1/2*c)-2*b)/(a^2+b^2)^(1/2)) )
Time = 0.33 (sec) , antiderivative size = 259, normalized size of antiderivative = 1.69 \[ \int \frac {\sec ^4(c+d x)}{a \cos (c+d x)+b \sin (c+d x)} \, dx=\frac {6 \, {\left (a^{2} + b^{2}\right )}^{\frac {3}{2}} \cos \left (d x + c\right )^{3} \log \left (-\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} + 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right ) - 3 \, {\left (2 \, a^{3} + 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, {\left (2 \, a^{3} + 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 6 \, a b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 4 \, b^{3} + 12 \, {\left (a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2}}{12 \, b^{4} d \cos \left (d x + c\right )^{3}} \]
1/12*(6*(a^2 + b^2)^(3/2)*cos(d*x + c)^3*log(-(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 - 2*a^2 - b^2 + 2*sqrt(a^2 + b^2)*(b*cos (d*x + c) - a*sin(d*x + c)))/(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2 )*cos(d*x + c)^2 + b^2)) - 3*(2*a^3 + 3*a*b^2)*cos(d*x + c)^3*log(sin(d*x + c) + 1) + 3*(2*a^3 + 3*a*b^2)*cos(d*x + c)^3*log(-sin(d*x + c) + 1) - 6* a*b^2*cos(d*x + c)*sin(d*x + c) + 4*b^3 + 12*(a^2*b + b^3)*cos(d*x + c)^2) /(b^4*d*cos(d*x + c)^3)
\[ \int \frac {\sec ^4(c+d x)}{a \cos (c+d x)+b \sin (c+d x)} \, dx=\int \frac {\sec ^{4}{\left (c + d x \right )}}{a \cos {\left (c + d x \right )} + b \sin {\left (c + d x \right )}}\, dx \]
Leaf count of result is larger than twice the leaf count of optimal. 361 vs. \(2 (143) = 286\).
Time = 0.32 (sec) , antiderivative size = 361, normalized size of antiderivative = 2.36 \[ \int \frac {\sec ^4(c+d x)}{a \cos (c+d x)+b \sin (c+d x)} \, dx=\frac {\frac {2 \, {\left (6 \, a^{2} + 8 \, b^{2} - \frac {3 \, a b \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {3 \, a b \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {12 \, {\left (a^{2} + b^{2}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {6 \, {\left (a^{2} + 2 \, b^{2}\right )} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}\right )}}{b^{3} - \frac {3 \, b^{3} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {3 \, b^{3} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {b^{3} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}} - \frac {3 \, {\left (2 \, a^{3} + 3 \, a b^{2}\right )} \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{b^{4}} + \frac {3 \, {\left (2 \, a^{3} + 3 \, a b^{2}\right )} \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{b^{4}} - \frac {6 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{\sqrt {a^{2} + b^{2}} b^{4}}}{6 \, d} \]
1/6*(2*(6*a^2 + 8*b^2 - 3*a*b*sin(d*x + c)/(cos(d*x + c) + 1) + 3*a*b*sin( d*x + c)^5/(cos(d*x + c) + 1)^5 - 12*(a^2 + b^2)*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + 6*(a^2 + 2*b^2)*sin(d*x + c)^4/(cos(d*x + c) + 1)^4)/(b^3 - 3 *b^3*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + 3*b^3*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 - b^3*sin(d*x + c)^6/(cos(d*x + c) + 1)^6) - 3*(2*a^3 + 3*a*b^2 )*log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/b^4 + 3*(2*a^3 + 3*a*b^2)*log(s in(d*x + c)/(cos(d*x + c) + 1) - 1)/b^4 - 6*(a^4 + 2*a^2*b^2 + b^4)*log((b - a*sin(d*x + c)/(cos(d*x + c) + 1) + sqrt(a^2 + b^2))/(b - a*sin(d*x + c )/(cos(d*x + c) + 1) - sqrt(a^2 + b^2)))/(sqrt(a^2 + b^2)*b^4))/d
Time = 0.35 (sec) , antiderivative size = 278, normalized size of antiderivative = 1.82 \[ \int \frac {\sec ^4(c+d x)}{a \cos (c+d x)+b \sin (c+d x)} \, dx=-\frac {\frac {3 \, {\left (2 \, a^{3} + 3 \, a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{b^{4}} - \frac {3 \, {\left (2 \, a^{3} + 3 \, a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{b^{4}} + \frac {6 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{\sqrt {a^{2} + b^{2}} b^{4}} + \frac {2 \, {\left (3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 12 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, a^{2} + 8 \, b^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3} b^{3}}}{6 \, d} \]
-1/6*(3*(2*a^3 + 3*a*b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1))/b^4 - 3*(2*a^ 3 + 3*a*b^2)*log(abs(tan(1/2*d*x + 1/2*c) - 1))/b^4 + 6*(a^4 + 2*a^2*b^2 + b^4)*log(abs(2*a*tan(1/2*d*x + 1/2*c) - 2*b - 2*sqrt(a^2 + b^2))/abs(2*a* tan(1/2*d*x + 1/2*c) - 2*b + 2*sqrt(a^2 + b^2)))/(sqrt(a^2 + b^2)*b^4) + 2 *(3*a*b*tan(1/2*d*x + 1/2*c)^5 + 6*a^2*tan(1/2*d*x + 1/2*c)^4 + 12*b^2*tan (1/2*d*x + 1/2*c)^4 - 12*a^2*tan(1/2*d*x + 1/2*c)^2 - 12*b^2*tan(1/2*d*x + 1/2*c)^2 - 3*a*b*tan(1/2*d*x + 1/2*c) + 6*a^2 + 8*b^2)/((tan(1/2*d*x + 1/ 2*c)^2 - 1)^3*b^3))/d
Time = 24.30 (sec) , antiderivative size = 724, normalized size of antiderivative = 4.73 \[ \int \frac {\sec ^4(c+d x)}{a \cos (c+d x)+b \sin (c+d x)} \, dx=\frac {b^3\,\left (\cos \left (c+d\,x\right )+\frac {\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {\cos \left (3\,c+3\,d\,x\right )}{3}+\frac {5}{6}\right )-b^2\,\left (\frac {a\,\sin \left (2\,c+2\,d\,x\right )}{4}+\frac {3\,a\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{4}+\frac {9\,a\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{4}\right )+b\,\left (\frac {3\,a^2\,\cos \left (c+d\,x\right )}{4}+\frac {a^2}{2}+\frac {a^2\,\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {a^2\,\cos \left (3\,c+3\,d\,x\right )}{4}\right )+\frac {\mathrm {atanh}\left (\frac {a^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6}+2\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6}+a\,b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^5+2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^4\,b+2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3\,b^2+4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^3+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^4+2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^5}\right )\,\cos \left (3\,c+3\,d\,x\right )\,\sqrt {{\left (a^2+b^2\right )}^3}}{2}-\frac {3\,a^3\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}-\frac {a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{2}+\frac {3\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {a^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6}+2\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6}+a\,b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^5+2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^4\,b+2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3\,b^2+4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^3+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^4+2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^5}\right )\,\sqrt {{\left (a^2+b^2\right )}^3}}{2}}{b^4\,d\,\left (\frac {3\,\cos \left (c+d\,x\right )}{4}+\frac {\cos \left (3\,c+3\,d\,x\right )}{4}\right )} \]
(b^3*(cos(c + d*x) + cos(2*c + 2*d*x)/2 + cos(3*c + 3*d*x)/3 + 5/6) - b^2* ((a*sin(2*c + 2*d*x))/4 + (3*a*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2) )*cos(3*c + 3*d*x))/4 + (9*a*cos(c + d*x)*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/4) + b*((3*a^2*cos(c + d*x))/4 + a^2/2 + (a^2*cos(2*c + 2*d* x))/2 + (a^2*cos(3*c + 3*d*x))/4) + (atanh((a^2*sin(c/2 + (d*x)/2)*(a^6 + b^6 + 3*a^2*b^4 + 3*a^4*b^2)^(1/2) + 2*b^2*sin(c/2 + (d*x)/2)*(a^6 + b^6 + 3*a^2*b^4 + 3*a^4*b^2)^(1/2) + a*b*cos(c/2 + (d*x)/2)*(a^6 + b^6 + 3*a^2* b^4 + 3*a^4*b^2)^(1/2))/(a^5*cos(c/2 + (d*x)/2) + 2*b^5*sin(c/2 + (d*x)/2) + a*b^4*cos(c/2 + (d*x)/2) + 2*a^4*b*sin(c/2 + (d*x)/2) + 2*a^3*b^2*cos(c /2 + (d*x)/2) + 4*a^2*b^3*sin(c/2 + (d*x)/2)))*cos(3*c + 3*d*x)*((a^2 + b^ 2)^3)^(1/2))/2 - (3*a^3*cos(c + d*x)*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d *x)/2)))/2 - (a^3*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*cos(3*c + 3 *d*x))/2 + (3*cos(c + d*x)*atanh((a^2*sin(c/2 + (d*x)/2)*(a^6 + b^6 + 3*a^ 2*b^4 + 3*a^4*b^2)^(1/2) + 2*b^2*sin(c/2 + (d*x)/2)*(a^6 + b^6 + 3*a^2*b^4 + 3*a^4*b^2)^(1/2) + a*b*cos(c/2 + (d*x)/2)*(a^6 + b^6 + 3*a^2*b^4 + 3*a^ 4*b^2)^(1/2))/(a^5*cos(c/2 + (d*x)/2) + 2*b^5*sin(c/2 + (d*x)/2) + a*b^4*c os(c/2 + (d*x)/2) + 2*a^4*b*sin(c/2 + (d*x)/2) + 2*a^3*b^2*cos(c/2 + (d*x) /2) + 4*a^2*b^3*sin(c/2 + (d*x)/2)))*((a^2 + b^2)^3)^(1/2))/2)/(b^4*d*((3* cos(c + d*x))/4 + cos(3*c + 3*d*x)/4))